﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Iguana.Core.HypterText.Attributes
{
    public class dir : IAttribute
    {
        private bool m_Required = true;
        private string m_Name;
        private string m_Value;
        private AttributeDataType m_Type;
        private HTML4Compliance m_Compliance;
        private List<String> m_AcceptableValues;

        public dir()
        {
            m_Name = "dir";

            m_AcceptableValues = new List<string>();

            m_AcceptableValues.Add("rtl");
            m_AcceptableValues.Add("ltr");

            m_Value = m_AcceptableValues[1];

            m_Type = AttributeDataType.TEXT;
            m_Required = false;
            m_Compliance = UtilDocTypes.ReturnCommonSTF();
        }

        public bool Required
        {
            get
            {
                return m_Required;
            }
            set
            {
                m_Required = value;
            }
        }

        public string Name
        {
            get
            {
                return m_Name;
            }
            set
            {
                m_Name = value;
            }
        }

        public string Value
        {
            get
            {
                return m_Value;
            }
            set
            {
                m_Value = UtilAttributes.SetAttribute(this, value);
            }
        }

        public AttributeDataType Type
        {
            get
            {
                return m_Type;
            }
            set
            {
                m_Type = value;
            }
        }

        public override string ToString()
        {
            return String.Format(SR.SR_ATTRIBUTE_NAME_VALUE_PAIR, Name, Value);
        }


        public HTML4Compliance CompiancyObject
        {
            get { return m_Compliance; }
        }


        public bool PreDefinedValues
        {
            get { return true; }
        }

        public List<string> AcceptableValues
        {
            get { return m_AcceptableValues; }
        }
    }
}
